﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using Excel;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Reflection;
    using System.Runtime.CompilerServices;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_BCPhatHanhHoaDon : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("CmdCapNhat")]
        private System.Windows.Forms.Button _CmdCapNhat;
        [AccessedThroughProperty("CmdExcel")]
        private System.Windows.Forms.Button _CmdExcel;
        [AccessedThroughProperty("CmdIn")]
        private System.Windows.Forms.Button _CmdIn;
        [AccessedThroughProperty("CmdThoat")]
        private System.Windows.Forms.Button _CmdThoat;
        [AccessedThroughProperty("Label1")]
        private System.Windows.Forms.Label _Label1;
        [AccessedThroughProperty("Panel1")]
        private Panel _Panel1;
        [AccessedThroughProperty("Panel2")]
        private Panel _Panel2;
        [AccessedThroughProperty("Panel3")]
        private Panel _Panel3;
        [AccessedThroughProperty("TxtNgayTBPH")]
        private DateTimePicker _TxtNgayTBPH;
        [AccessedThroughProperty("VSlist")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSlist;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private clsMauHoaDon objMHD;
        private System.Data.DataTable pData;
        private string strNgayTBPH;

        public Frm_BCPhatHanhHoaDon()
        {
            base.Load += new EventHandler(this.Frm_BCPhatHanhHoaDon_Load);
            base.Resize += new EventHandler(this.Frm_BCPhatHanhHoaDon_Resize);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.strNgayTBPH = "";
            this.pData = null;
            this.objMHD = new clsMauHoaDon();
            this.InitializeComponent();
        }

        private void CmdCapNhat_Click(object sender, EventArgs e)
        {
            this.LoadData();
        }

        private void CmdExcel_Click(object sender, EventArgs e)
        {
            if (this.pData != null)
            {
                if (this.pData.Rows.Count == 0)
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
                }
                else
                {
                    try
                    {
                        SaveFileDialog dialog = new SaveFileDialog {
                            Filter = "Excel Files|*.xls",
                            Title = "Save an Excel file"
                        };
                        dialog.ShowDialog();
                        if (dialog.FileName != "")
                        {
                            this.VSlist.SaveExcel(dialog.FileName, "THONGBAOPHATHANHHOADON", FileFlags.None);
                            Excel.Application application = new ApplicationClass();
                            Workbook workbook = application.Workbooks.Open(dialog.FileName, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
                            Excel.Application application2 = application;
                            NewLateBinding.LateCall(application2.Worksheets[1], null, "Select", new object[0], null, null, null, true);
                            application2.get_Range("A1:L" + Conversions.ToString((int) (this.VSlist.Rows.Count - 2)), Missing.Value).Select();
                            NewLateBinding.LateCall(application2.Selection, null, "Cut", new object[0], null, null, null, true);
                            application2.get_Range("A16", Missing.Value).Select();
                            NewLateBinding.LateCall(application2.ActiveSheet, null, "Paste", new object[0], null, null, null, true);
                            application2.get_Range("A16:L" + Conversions.ToString((int) (this.VSlist.Rows.Count + 13)), Missing.Value).Select();
                            Excel.Font font = application2.ActiveCell.get_Characters(1, 200).Font;
                            font.Name = "Times New Roman";
                            font.FontStyle = "Regular";
                            font.Size = 11;
                            font = null;
                            application2.get_Range("A14:L" + Conversions.ToString((int) (this.VSlist.Rows.Count + 13)), Missing.Value).Select();
                            NewLateBinding.LateSetComplex(NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 5 }, null, null, null), null, "LineStyle", new object[] { -4142 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 6 }, null, null, null), null, "LineStyle", new object[] { -4142 }, null, null, false, true);
                            object instance = NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 7 }, null, null, null);
                            NewLateBinding.LateSetComplex(instance, null, "LineStyle", new object[] { 1 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(instance, null, "ColorIndex", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(instance, null, "Weight", new object[] { 2 }, null, null, false, true);
                            instance = null;
                            object obj3 = NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 8 }, null, null, null);
                            NewLateBinding.LateSetComplex(obj3, null, "LineStyle", new object[] { 1 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj3, null, "ColorIndex", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj3, null, "Weight", new object[] { 2 }, null, null, false, true);
                            obj3 = null;
                            object obj4 = NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 9 }, null, null, null);
                            NewLateBinding.LateSetComplex(obj4, null, "LineStyle", new object[] { 1 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj4, null, "ColorIndex", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj4, null, "Weight", new object[] { 2 }, null, null, false, true);
                            obj4 = null;
                            object obj5 = NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 10 }, null, null, null);
                            NewLateBinding.LateSetComplex(obj5, null, "LineStyle", new object[] { 1 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj5, null, "ColorIndex", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj5, null, "Weight", new object[] { 2 }, null, null, false, true);
                            obj5 = null;
                            object obj6 = NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 11 }, null, null, null);
                            NewLateBinding.LateSetComplex(obj6, null, "LineStyle", new object[] { 1 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj6, null, "ColorIndex", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj6, null, "Weight", new object[] { 2 }, null, null, false, true);
                            obj6 = null;
                            object obj7 = NewLateBinding.LateGet(application2.Selection, null, "Borders", new object[] { 12 }, null, null, null);
                            NewLateBinding.LateSetComplex(obj7, null, "LineStyle", new object[] { 1 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj7, null, "ColorIndex", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj7, null, "Weight", new object[] { 2 }, null, null, false, true);
                            obj7 = null;
                            application2.get_Range("A14:A15", Missing.Value).Select();
                            object selection = application2.Selection;
                            NewLateBinding.LateSetComplex(selection, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(selection, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(selection, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(selection, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(selection, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(selection, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(selection, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(selection, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(selection, null, "MergeCells", new object[] { true }, null, null, false, true);
                            selection = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("A14:A15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "STT";
                            application2.get_Range("B14:B15", Missing.Value).Select();
                            object obj9 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj9, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj9, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj9, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj9, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj9, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj9, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj9, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj9, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj9, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj9 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("B14:B15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "T\x00ean loại h\x00f3a đơn";
                            application2.get_Range("C14:C15", Missing.Value).Select();
                            object obj10 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj10, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj10, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj10, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj10, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj10, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj10, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj10, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj10, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj10, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj10 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("C14:C15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Mẫu số";
                            application2.get_Range("D14:D15", Missing.Value).Select();
                            object obj11 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj11, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj11, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj11, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj11, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj11, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj11, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj11, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj11, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj11, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj11 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("D14:D15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "K\x00fd hiệu";
                            application2.get_Range("E14:E15", Missing.Value).Select();
                            object obj12 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj12, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj12, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj12, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj12, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj12, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj12, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj12, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj12, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj12, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj12 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("E14:E15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Số lượng";
                            application2.get_Range("F14:F15", Missing.Value).Select();
                            object obj13 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj13, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj13, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj13, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj13, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj13, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj13, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj13, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj13, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj13, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj13 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("F14:F15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Từ số";
                            application2.get_Range("G14:G15", Missing.Value).Select();
                            object obj14 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj14, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj14, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj14, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj14, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj14, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj14, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj14, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj14, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj14, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj14 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("G14:G15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Đến số";
                            application2.get_Range("H14:H15", Missing.Value).Select();
                            object obj15 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj15, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj15, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj15, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj15, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj15, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj15, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj15, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj15, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj15, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj15 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("H14:H15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Ng\x00e0y bắt đầu\nsử dụng";
                            application2.get_Range("I14:J14", Missing.Value).Select();
                            object obj16 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj16, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj16, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj16, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj16, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj16, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj16, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj16, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj16, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj16, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj16 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("I14:J14", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Doanh nghiệp in";
                            application2.get_Range("K14:L14", Missing.Value).Select();
                            object obj17 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj17, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj17, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj17, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj17, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj17, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj17, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj17, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj17, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj17, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj17 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("K14:L14", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Hợp đồng";
                            application2.get_Range("I15", Missing.Value).Select();
                            object obj18 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj18, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj18, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj18, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj18, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj18, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj18, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj18, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj18, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj18, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj18 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("I15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "T\x00ean";
                            application2.get_Range("J15", Missing.Value).Select();
                            object obj19 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj19, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj19, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj19, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj19, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj19, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj19, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj19, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj19, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj19, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj19 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("J15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "MST";
                            application2.get_Range("K15", Missing.Value).Select();
                            object obj20 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj20, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj20, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj20, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj20, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj20, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj20, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj20, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj20, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj20, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj20 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("K15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Số";
                            application2.get_Range("L15", Missing.Value).Select();
                            object obj21 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj21, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj21, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj21, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj21, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj21, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj21, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj21, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj21, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj21, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj21 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("L15", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "Ng\x00e0y";
                            application2.get_Range("B8", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "1. T\x00ean đơn vị ph\x00e1t h\x00e0nh h\x00f3a đơn: " + modGeneral.H_COMPANYNAMEVIET;
                            application2.get_Range("B9", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "2. M\x00e3 số thuế: " + modGeneral.H_TAXCODE;
                            application2.get_Range("B10", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "3. Địa chỉ trụ sở ch\x00ednh: " + modGeneral.H_ADDRESS;
                            application2.get_Range("B11", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "4. Điện thoại: " + modGeneral.H_TELEPHONE;
                            application2.get_Range("B12", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "5. C\x00e1c loại h\x00f3a đơn ph\x00e1t h\x00e0nh:";
                            application2.get_Range("B" + Conversions.ToString((int) (this.VSlist.Rows.Count + 15)), Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "6. Th\x00f4ng tin đơn vị chủ quản (trường hợp tổ chức, c\x00e1 nh\x00e2n d\x00f9ng h\x00f3a đơn của đơn vị chủ quản đặt in, tự in): ";
                            application2.get_Range("B" + Conversions.ToString((int) (this.VSlist.Rows.Count + 0x10)), Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = " - T\x00ean đơn vị: " + modGeneral.H_DONVICHUQUAN;
                            application2.get_Range("B" + Conversions.ToString((int) (this.VSlist.Rows.Count + 0x11)), Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = " - M\x00e3 số thuế: " + modGeneral.H_MSTDONVICHUQUAN;
                            application2.get_Range("B" + Conversions.ToString((int) (this.VSlist.Rows.Count + 0x12)), Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "7. T\x00ean cơ quan thuế tiếp nhận th\x00f4ng b\x00e1o: " + modGeneral.H_COQUANTHUE;
                            application2.get_Range("I" + Conversions.ToString((int) (this.VSlist.Rows.Count + 0x13)) + ":L" + Conversions.ToString((int) (this.VSlist.Rows.Count + 0x13)), Missing.Value).Select();
                            object obj22 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj22, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj22, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj22, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj22, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj22, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj22, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj22, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj22, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj22, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj22 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("I" + Conversions.ToString((int) (this.VSlist.Rows.Count + 0x13)) + ":L" + Conversions.ToString((int) (this.VSlist.Rows.Count + 0x13)), Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "... ... ... ..., ng\x00e0y " + LVYModule.sRight(this.strNgayTBPH, 2) + " th\x00e1ng " + this.strNgayTBPH.Substring(4, 2) + " năm " + LVYModule.sLeft(this.strNgayTBPH, 4);
                            Excel.Font font2 = application2.ActiveCell.get_Characters(1, 200).Font;
                            font2.Name = "Times New Roman";
                            font2.FontStyle = "Italic";
                            font2.Size = 11;
                            font2 = null;
                            application2.get_Range("I" + Conversions.ToString((int) (this.VSlist.Rows.Count + 20)) + ":L" + Conversions.ToString((int) (this.VSlist.Rows.Count + 20)), Missing.Value).Select();
                            object obj23 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj23, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj23, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj23, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj23, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj23, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj23, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj23, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj23, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj23, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj23 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("I" + Conversions.ToString((int) (this.VSlist.Rows.Count + 20)) + ":L" + Conversions.ToString((int) (this.VSlist.Rows.Count + 20)), Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "NGƯỜI ĐẠI DIỆN THEO PH\x00c1P LUẬT";
                            Excel.Font font3 = application2.ActiveCell.get_Characters(1, 200).Font;
                            font3.Name = "Times New Roman";
                            font3.FontStyle = "Bold";
                            font3.Size = 11;
                            font3 = null;
                            application2.get_Range("I" + Conversions.ToString((int) (this.VSlist.Rows.Count + 0x15)) + ":L" + Conversions.ToString((int) (this.VSlist.Rows.Count + 0x15)), Missing.Value).Select();
                            object obj24 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj24, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj24, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj24, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj24, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj24, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj24, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj24, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj24, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj24, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj24 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("I" + Conversions.ToString((int) (this.VSlist.Rows.Count + 0x15)) + ":L" + Conversions.ToString((int) (this.VSlist.Rows.Count + 0x15)), Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "(K\x00fd, đ\x00f3ng dấu v\x00e0 ghi r\x00f5 họ t\x00ean)";
                            Excel.Font font4 = application2.ActiveCell.get_Characters(1, 200).Font;
                            font4.Name = "Times New Roman";
                            font4.FontStyle = "Italic";
                            font4.Size = 11;
                            font4 = null;
                            application2.get_Range("A5:L5", Missing.Value).Select();
                            object obj25 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj25, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj25, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj25, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj25, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj25, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj25, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj25, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj25, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj25, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj25 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("A5:L5", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "TH\x00d4NG B\x00c1O PH\x00c1T H\x00c0NH H\x00d3A ĐƠN";
                            Excel.Font font5 = application2.ActiveCell.get_Characters(1, 200).Font;
                            font5.Name = "Times New Roman";
                            font5.FontStyle = "Bold";
                            font5.Size = 0x10;
                            font5 = null;
                            application2.get_Range("A6:L6", Missing.Value).Select();
                            object obj26 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj26, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj26, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj26, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj26, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj26, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj26, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj26, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj26, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj26, null, "MergeCells", new object[] { true }, null, null, false, true);
                            obj26 = null;
                            NewLateBinding.LateCall(application2.Selection, null, "Merge", new object[0], null, null, null, true);
                            application2.get_Range("A6:L6", Missing.Value).Select();
                            application2.ActiveCell.FormulaR1C1 = "(D\x00e0nh cho tổ chức, c\x00e1 nh\x00e2n kinh doanh đặt in, tự in)";
                            Excel.Font font6 = application2.ActiveCell.get_Characters(1, 200).Font;
                            font6.Name = "Times New Roman";
                            font6.FontStyle = "Italic";
                            font6.Size = 12;
                            font6 = null;
                            application2.get_Range("B8:B12", Missing.Value).Select();
                            NewLateBinding.LateSetComplex(NewLateBinding.LateGet(application2.Selection, null, "Font", new object[0], null, null, null), null, "Bold", new object[] { true }, null, null, false, true);
                            object obj27 = NewLateBinding.LateGet(application2.Selection, null, "Font", new object[0], null, null, null);
                            NewLateBinding.LateSetComplex(obj27, null, "Name", new object[] { "Times New Roman" }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj27, null, "Size", new object[] { 11 }, null, null, false, true);
                            obj27 = null;
                            application2.get_Range("B" + Conversions.ToString((int) (this.VSlist.Rows.Count + 15)) + ":B" + Conversions.ToString((int) (this.VSlist.Rows.Count + 0x12)), Missing.Value).Select();
                            NewLateBinding.LateSetComplex(NewLateBinding.LateGet(application2.Selection, null, "Font", new object[0], null, null, null), null, "Bold", new object[] { true }, null, null, false, true);
                            object obj28 = NewLateBinding.LateGet(application2.Selection, null, "Font", new object[0], null, null, null);
                            NewLateBinding.LateSetComplex(obj28, null, "Name", new object[] { "Times New Roman" }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj28, null, "Size", new object[] { 11 }, null, null, false, true);
                            obj28 = null;
                            application2.get_Range("A" + Conversions.ToString((int) (this.VSlist.Rows.Count + 13)) + ":L" + Conversions.ToString((int) (this.VSlist.Rows.Count + 13)), Missing.Value).Select();
                            NewLateBinding.LateSetComplex(NewLateBinding.LateGet(application2.Selection, null, "Font", new object[0], null, null, null), null, "Bold", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(application2.Rows["5:5", Missing.Value], null, "RowHeight", new object[] { 0x19 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(application2.Rows["6:6", Missing.Value], null, "RowHeight", new object[] { 20 }, null, null, false, true);
                            int num2 = this.VSlist.Rows.Count + 0x15;
                            for (int i = 8; i <= num2; i++)
                            {
                                NewLateBinding.LateSetComplex(application2.Rows[Conversions.ToString(i) + ":" + Conversions.ToString(i), Missing.Value], null, "RowHeight", new object[] { 20 }, null, null, false, true);
                            }
                            application2.get_Range("A16:L" + Conversions.ToString((int) (this.VSlist.Rows.Count + 13)), Missing.Value).Select();
                            object obj29 = application2.Selection;
                            NewLateBinding.LateSetComplex(obj29, null, "HorizontalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj29, null, "VerticalAlignment", new object[] { -4108 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj29, null, "WrapText", new object[] { true }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj29, null, "Orientation", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj29, null, "AddIndent", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj29, null, "IndentLevel", new object[] { 0 }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj29, null, "ShrinkToFit", new object[] { false }, null, null, false, true);
                            NewLateBinding.LateSetComplex(obj29, null, "ReadingOrder", new object[] { -5002 }, null, null, false, true);
                            obj29 = null;
                            application2.get_Range("I16:I" + Conversions.ToString((int) (this.VSlist.Rows.Count + 13)), Missing.Value).Select();
                            NewLateBinding.LateSetComplex(application2.Selection, null, "HorizontalAlignment", new object[] { -4131 }, null, null, false, true);
                            application2.get_Range("A5:L5", Missing.Value).Select();
                            application2 = null;
                            application.SaveWorkspace(Missing.Value);
                            application.Visible = true;
                        }
                    }
                    catch (COMException exception1)
                    {
                        ProjectData.SetProjectError(exception1);
                        COMException exception = exception1;
                        MessageBox.Show(exception.Message);
                        ProjectData.ClearProjectError();
                    }
                    catch (Exception exception3)
                    {
                        ProjectData.SetProjectError(exception3);
                        Exception exception2 = exception3;
                        MessageBox.Show(exception2.Message);
                        ProjectData.ClearProjectError();
                    }
                }
            }
        }

        private void CmdIn_Click(object sender, EventArgs e)
        {
            if (this.pData != null)
            {
                if (this.pData.Rows.Count == 0)
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
                }
                else
                {
                    this.Cursor = Cursors.WaitCursor;
                    Rpt_BCPhatHanhHoaDon don = new Rpt_BCPhatHanhHoaDon();
                    try
                    {
                        don.SetDataSource(this.pData);
                        if (modGeneral.H_LANGUAGE == "VIET")
                        {
                            don.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                        }
                        else
                        {
                            don.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                        }
                        don.SetParameterValue(1, modGeneral.Tranlated(modGeneral.H_TAXCODE, ""));
                        don.SetParameterValue(2, modGeneral.Tranlated(modGeneral.H_ADDRESS, ""));
                        don.SetParameterValue(3, modGeneral.Tranlated(modGeneral.H_TELEPHONE, ""));
                        don.SetParameterValue(4, modGeneral.Tranlated(modGeneral.H_DONVICHUQUAN, ""));
                        don.SetParameterValue(5, modGeneral.Tranlated(modGeneral.H_MSTDONVICHUQUAN, ""));
                        don.SetParameterValue(6, modGeneral.Tranlated(modGeneral.H_COQUANTHUE, ""));
                        don.SetParameterValue(7, "... ... ... ..., ng\x00e0y " + LVYModule.sRight(this.strNgayTBPH, 2) + " th\x00e1ng " + this.strNgayTBPH.Substring(4, 2) + " năm " + LVYModule.sLeft(this.strNgayTBPH, 4));
                        MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = don;
                        MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                        MyProject.Forms.Frm_ViewReport.ShowDialog();
                        this.Cursor = Cursors.Default;
                    }
                    catch (Exception exception1)
                    {
                        ProjectData.SetProjectError(exception1);
                        Exception exception = exception1;
                        this.Cursor = Cursors.Default;
                        MessageBox.Show(exception.Message.ToString());
                        ProjectData.ClearProjectError();
                    }
                }
            }
        }

        private void CmdThoat_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (disposing && (this.components != null))
                {
                    this.components.Dispose();
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }

        private void Frm_BCPhatHanhHoaDon_Load(object sender, EventArgs e)
        {
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.TxtNgayTBPH.Text = Conversions.ToString(DateAndTime.Today);
                this.MergeColumn();
            }
        }

        private void Frm_BCPhatHanhHoaDon_Resize(object sender, EventArgs e)
        {
            if (this.Visible)
            {
                C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
                vSlist.Cols[8].Width = this.VSlist.Width - ((((((((((vSlist.Cols[1].Width + vSlist.Cols[2].Width) + vSlist.Cols[3].Width) + vSlist.Cols[4].Width) + vSlist.Cols[5].Width) + vSlist.Cols[6].Width) + vSlist.Cols[7].Width) + vSlist.Cols[9].Width) + vSlist.Cols[10].Width) + vSlist.Cols[11].Width) + SystemInformation.VerticalScrollBarWidth);
                vSlist = null;
            }
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_BCPhatHanhHoaDon));
            this.Panel1 = new Panel();
            this.Label1 = new System.Windows.Forms.Label();
            this.TxtNgayTBPH = new DateTimePicker();
            this.Panel3 = new Panel();
            this.CmdThoat = new System.Windows.Forms.Button();
            this.CmdExcel = new System.Windows.Forms.Button();
            this.CmdCapNhat = new System.Windows.Forms.Button();
            this.CmdIn = new System.Windows.Forms.Button();
            this.Panel2 = new Panel();
            this.VSlist = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.Panel1.SuspendLayout();
            this.Panel3.SuspendLayout();
            this.VSlist.BeginInit();
            this.SuspendLayout();
            this.Panel1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel1.Controls.Add(this.Label1);
            this.Panel1.Controls.Add(this.TxtNgayTBPH);
            this.Panel1.Controls.Add(this.Panel3);
            this.Panel1.Dock = DockStyle.Top;
            System.Drawing.Point point = new System.Drawing.Point(0, 0);
            this.Panel1.Location = point;
            this.Panel1.Name = "Panel1";
            Size size = new Size(0x431, 0x2f);
            this.Panel1.Size = size;
            this.Panel1.TabIndex = 0;
            this.Label1.AutoSize = true;
            this.Label1.BackColor = Color.Transparent;
            point = new System.Drawing.Point(12, 0x13);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x86, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 0x45;
            this.Label1.Text = "Ng\x00e0y th\x00f4ng b\x00e1o ph\x00e1t h\x00e0nh";
            this.TxtNgayTBPH.Format = DateTimePickerFormat.Short;
            point = new System.Drawing.Point(0x98, 15);
            this.TxtNgayTBPH.Location = point;
            this.TxtNgayTBPH.Name = "TxtNgayTBPH";
            size = new Size(0x56, 20);
            this.TxtNgayTBPH.Size = size;
            this.TxtNgayTBPH.TabIndex = 0x44;
            DateTime time = new DateTime(0x7d7, 11, 1, 0, 0, 0, 0);
            this.TxtNgayTBPH.Value = time;
            this.Panel3.BackColor = Color.Transparent;
            this.Panel3.Controls.Add(this.CmdThoat);
            this.Panel3.Controls.Add(this.CmdExcel);
            this.Panel3.Controls.Add(this.CmdCapNhat);
            this.Panel3.Controls.Add(this.CmdIn);
            this.Panel3.Dock = DockStyle.Right;
            point = new System.Drawing.Point(0x2eb, 0);
            this.Panel3.Location = point;
            this.Panel3.Name = "Panel3";
            size = new Size(0x146, 0x2f);
            this.Panel3.Size = size;
            this.Panel3.TabIndex = 6;
            point = new System.Drawing.Point(0xf6, 6);
            this.CmdThoat.Location = point;
            this.CmdThoat.Name = "CmdThoat";
            size = new Size(0x4b, 0x21);
            this.CmdThoat.Size = size;
            this.CmdThoat.TabIndex = 4;
            this.CmdThoat.Text = "Tho\x00e1t";
            this.CmdThoat.UseVisualStyleBackColor = true;
            point = new System.Drawing.Point(0xa5, 6);
            this.CmdExcel.Location = point;
            this.CmdExcel.Name = "CmdExcel";
            size = new Size(0x4b, 0x21);
            this.CmdExcel.Size = size;
            this.CmdExcel.TabIndex = 4;
            this.CmdExcel.Text = "Excel";
            this.CmdExcel.UseVisualStyleBackColor = true;
            point = new System.Drawing.Point(3, 6);
            this.CmdCapNhat.Location = point;
            this.CmdCapNhat.Name = "CmdCapNhat";
            size = new Size(0x4b, 0x21);
            this.CmdCapNhat.Size = size;
            this.CmdCapNhat.TabIndex = 4;
            this.CmdCapNhat.Text = "Cập nhật";
            this.CmdCapNhat.UseVisualStyleBackColor = true;
            point = new System.Drawing.Point(0x54, 6);
            this.CmdIn.Location = point;
            this.CmdIn.Name = "CmdIn";
            size = new Size(0x4b, 0x21);
            this.CmdIn.Size = size;
            this.CmdIn.TabIndex = 4;
            this.CmdIn.Text = "In b\x00e1o c\x00e1o";
            this.CmdIn.UseVisualStyleBackColor = true;
            this.Panel2.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel2.Dock = DockStyle.Bottom;
            point = new System.Drawing.Point(0, 0x1a8);
            this.Panel2.Location = point;
            this.Panel2.Name = "Panel2";
            size = new Size(0x431, 0x1d);
            this.Panel2.Size = size;
            this.Panel2.TabIndex = 1;
            this.VSlist.AllowEditing = false;
            this.VSlist.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSlist.ColumnInfo = "12,0,0,0,0,85,Columns:0{Width:40;}\t1{Width:80;}\t";
            this.VSlist.Dock = DockStyle.Fill;
            this.VSlist.ExtendLastCol = true;
            this.VSlist.FocusRect = FocusRectEnum.None;
            point = new System.Drawing.Point(0, 0x2f);
            this.VSlist.Location = point;
            this.VSlist.Name = "VSlist";
            this.VSlist.Rows.Count = 2;
            this.VSlist.Rows.DefaultSize = 0x11;
            this.VSlist.Rows.Fixed = 2;
            this.VSlist.SelectionMode = SelectionModeEnum.Row;
            size = new Size(0x431, 0x179);
            this.VSlist.Size = size;
            this.VSlist.StyleInfo = manager.GetString("VSlist.StyleInfo");
            this.VSlist.TabIndex = 10;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            this.BackgroundImage = ACCOUNTING.My.Resources.Resources.background;
            size = new Size(0x431, 0x1c5);
            this.ClientSize = size;
            this.Controls.Add(this.VSlist);
            this.Controls.Add(this.Panel2);
            this.Controls.Add(this.Panel1);
            this.Name = "Frm_BCPhatHanhHoaDon";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "BC-HD02";
            this.Text = "THONG BAO PHAT HANH HOA DON";
            this.Panel1.ResumeLayout(false);
            this.Panel1.PerformLayout();
            this.Panel3.ResumeLayout(false);
            this.VSlist.EndInit();
            this.ResumeLayout(false);
        }

        public void LoadData()
        {
            this.Cursor = Cursors.WaitCursor;
            this.VSlist.Select(0, 1);
            this.VSlist.Rows.Count = 2;
            this.strNgayTBPH = LVYModule.Date2Char(this.TxtNgayTBPH.Text.Trim());
            this.pData = this.objMHD.GetData_ThongBaoPhatHanh(" DK.NgayBDSD >= '" + this.strNgayTBPH + "' AND SoDuDK = 0");
            int num3 = this.pData.Rows.Count - 1;
            for (int i = 0; i <= num3; i++)
            {
                C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
                vSlist.AddItem("");
                vSlist[vSlist.Rows.Count - 1, 0] = LVYModule.sRight("00" + Conversions.ToString((int) (i + 1)), 2);
                vSlist[vSlist.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["LoaiHoaDon"]);
                vSlist[vSlist.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["MauHoaDon"]);
                vSlist[vSlist.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["SoKiHieu"]);
                vSlist[vSlist.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["SoLuong"]);
                vSlist[vSlist.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["TuSo"]);
                vSlist[vSlist.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["DenSo"]);
                vSlist[vSlist.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(this.pData.Rows[i]["NgayBDSD"]);
                vSlist[vSlist.Rows.Count - 1, 8] = modGeneral.H_COMPANYNAMEVIET;
                vSlist[vSlist.Rows.Count - 1, 9] = modGeneral.H_TAXCODE;
                vSlist = null;
                int num4 = this.VSlist.Cols.Count - 1;
                for (int j = 0; j <= num4; j++)
                {
                    if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(this.VSlist[this.VSlist.Rows.Count - 1, j], "0000000", false))
                    {
                        this.VSlist[this.VSlist.Rows.Count - 1, j] = " ";
                    }
                }
            }
            this.VSlist.Cols[0].TextAlign = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[2].TextAlign = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[3].TextAlign = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[4].TextAlign = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[5].TextAlign = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[6].TextAlign = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[7].TextAlign = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[9].TextAlign = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[10].TextAlign = TextAlignEnum.CenterCenter;
            this.VSlist.Cols[11].TextAlign = TextAlignEnum.CenterCenter;
            this.VSlist.AddItem("");
            this.VSlist[this.VSlist.Rows.Count - 1, 1] = "Tổng cộng";
            this.VSlist[this.VSlist.Rows.Count - 1, 4] = LVYModule.SumColGrid(this.VSlist, 4);
            if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(this.VSlist[this.VSlist.Rows.Count - 1, 4], 0, false))
            {
                this.VSlist[this.VSlist.Rows.Count - 1, 4] = "";
            }
            LVYModule.SetColorForGrid(this.VSlist, Color.GreenYellow, this.VSlist.Rows.Count - 1, 0, 0, 0);
            this.Cursor = Cursors.Default;
        }

        public void MergeColumn()
        {
            CellRange range = new CellRange();
            //this.VSlist.GetCellRange(0, 0, 1, 0).Data = "STT";
            //this.VSlist.GetCellRange(0, 1, 1, 1).Data = "T\x00ean loại h\x00f3a đơn";
            //this.VSlist.GetCellRange(0, 2, 1, 2).Data = "Mẫu số";
            //this.VSlist.GetCellRange(0, 3, 1, 3).Data = "K\x00fd hiệu";
            //this.VSlist.GetCellRange(0, 4, 1, 4).Data = "Số lượng";
            //this.VSlist.GetCellRange(0, 5, 1, 5).Data = "Từ số";
            //this.VSlist.GetCellRange(0, 6, 1, 6).Data = "Đến số";
            //this.VSlist.GetCellRange(0, 7, 1, 7).Data = "Ng\x00e0y bắt đầu sử dụng";
            //this.VSlist.GetCellRange(0, 8, 0, 9).Data = "Doanh nghiệp in";
            //this.VSlist.GetCellRange(0, 10, 0, 11).Data = "Hợp đồng";
            this.VSlist[1, 8] = "T\x00ean";
            this.VSlist[1, 9] = "MST";
            this.VSlist[1, 10] = "Số";
            this.VSlist[1, 11] = "Ng\x00e0y";
            C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
            vSlist.Cols[0].Width = 30;
            vSlist.Cols[1].Width = 100;
            vSlist.Cols[2].Width = 90;
            vSlist.Cols[3].Width = 70;
            vSlist.Cols[4].Width = 40;
            vSlist.Cols[5].Width = 60;
            vSlist.Cols[6].Width = 60;
            vSlist.Cols[7].Width = 100;
            vSlist.Cols[9].Width = 100;
            vSlist.Cols[10].Width = 100;
            vSlist.Cols[11].Width = 100;
            vSlist.Cols[8].Width = this.VSlist.Width - ((((((((((vSlist.Cols[1].Width + vSlist.Cols[2].Width) + vSlist.Cols[3].Width) + vSlist.Cols[4].Width) + vSlist.Cols[5].Width) + vSlist.Cols[6].Width) + vSlist.Cols[7].Width) + vSlist.Cols[9].Width) + vSlist.Cols[10].Width) + vSlist.Cols[11].Width) + SystemInformation.VerticalScrollBarWidth);
            vSlist = null;
            this.VSlist.Styles.Fixed.WordWrap = true;
            int num3 = this.VSlist.Cols.Count - 1;
            for (int i = 0; i <= num3; i++)
            {
                this.VSlist.Cols[i].AllowMerging = true;
            }
            this.VSlist.Rows[0].AllowMerging = true;
            this.VSlist.Rows[1].AllowMerging = true;
            this.VSlist.Rows[0].Height = 0x19;
            this.VSlist.Rows[1].Height = 0x19;
            this.VSlist.AllowMerging = AllowMergingEnum.FixedOnly;
            int num4 = this.VSlist.Cols.Count - 1;
            for (int j = 0; j <= num4; j++)
            {
                this.VSlist.Cols[j].TextAlignFixed = TextAlignEnum.CenterCenter;
            }
        }

        internal virtual System.Windows.Forms.Button CmdCapNhat
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdCapNhat;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdCapNhat_Click);
                if (this._CmdCapNhat != null)
                {
                    this._CmdCapNhat.Click -= handler;
                }
                this._CmdCapNhat = value;
                if (this._CmdCapNhat != null)
                {
                    this._CmdCapNhat.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Button CmdExcel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExcel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExcel_Click);
                if (this._CmdExcel != null)
                {
                    this._CmdExcel.Click -= handler;
                }
                this._CmdExcel = value;
                if (this._CmdExcel != null)
                {
                    this._CmdExcel.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Button CmdIn
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdIn;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdIn_Click);
                if (this._CmdIn != null)
                {
                    this._CmdIn.Click -= handler;
                }
                this._CmdIn = value;
                if (this._CmdIn != null)
                {
                    this._CmdIn.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Button CmdThoat
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdThoat;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdThoat_Click);
                if (this._CmdThoat != null)
                {
                    this._CmdThoat.Click -= handler;
                }
                this._CmdThoat = value;
                if (this._CmdThoat != null)
                {
                    this._CmdThoat.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Panel Panel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel1 = value;
            }
        }

        internal virtual Panel Panel2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel2 = value;
            }
        }

        internal virtual Panel Panel3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel3 = value;
            }
        }

        internal virtual DateTimePicker TxtNgayTBPH
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayTBPH;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayTBPH = value;
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSlist
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSlist;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._VSlist = value;
            }
        }
    }
}

